import { defHttp } from '/@/utils/http/axios';
import { IPostUserStatusRaw } from '/@/types/system/senior/user/status';
import { IPostUserAddRequest } from '/@/types/system/senior/user/add';
import { IPostUserListRequest, IPostUserListResponse } from '/@/types/system/senior/user/list';
import { IPostUserExcelQuery, IGetUserExcelQuery } from '/@/types/system/senior/user/excel';
import { IPostUserQueryRequest, IPostUserQueryResponse } from '/@/types/system/senior/user/query';
import { IGetRawUserDetailsResponse } from '/@/types/system/senior/user/details';
import { IPostUserPasswordRaw } from '/@/types/system/senior/user/password';

/**
 * 修改用户状态
 */
export const apiPostUserStatusPath = (userId: string | number, params: IPostUserStatusRaw) =>
  defHttp.post({ url: `/system/senior/user/status/${userId}`, params });
/**
 * 删除用户
 */
export const apiDeleteUserDeletePath = (userIds: string | number) =>
  defHttp.delete({ url: `/system/senior/user/delete/${userIds}` });
/**
 * 新增用户
 */
export const apiPostUserAdd = (params: IPostUserAddRequest) =>
  defHttp.post({ url: `/system/senior/user/add`, params });
/**
 * 用户列表
 */
export const apiPostUserList = (params: IPostUserListRequest) =>
  defHttp.post<IPostUserListResponse>({ url: `/system/senior/user/list`, params });
/**
 * 用户列表导入
 */
export const apiPostUserExcelQuery = (params: IPostUserExcelQuery) =>
  defHttp.post({ url: `/system/senior/user/excel`, params });
/**
 * 用户列表导出
 */
export const apiGetUserExcelQuery = (params: IGetUserExcelQuery) =>
  defHttp.get({ url: `/system/senior/user/excel`, params });
/**
 * 用户列表选项
 */
export const apiPostUserQuery = (params: IPostUserQueryRequest) =>
  defHttp.post<IPostUserQueryResponse>({ url: `/system/senior/user/query`, params });
/**
 * 用户导入excel下载
 */
export const apiGetUserExcelTemplate = () =>
  defHttp.get({ url: `/system/senior/user/excelTemplate` });
/**
 * 用户详情
 */
export const apiGetUserDetailsPath = (userId: string | number) =>
  defHttp.get<IGetRawUserDetailsResponse>({ url: `/system/senior/user/details/${userId}` });
/**
 * 重置用户密码
 */
export const apiPostUserPasswordPath = (userId: string | number, params: IPostUserPasswordRaw) =>
  defHttp.post({ url: `/system/senior/user/password/${userId}`, params });
